import Mock from 'mockjs'


// 修改分布数据API
export const mockSignalDistribution = () => {
  Mock.mock(/\/api\/signal\/distribution/, 'get', (options) => {
    const data = {
      '4G': [
        { coord: [120.123, 30.240,], value: -53 },
        { coord: [120.124, 30.241], value: -64 },
        { coord: [120.125, 30.242], value: -41 },
        { coord: [120.126, 30.243], value: -82 },
        { coord: [120.127, 30.244], value: -45 },
        { coord: [120.128, 30.245], value: -68 },
        { coord: [120.129, 30.246], value: -39 },
        { coord: [120.130, 30.247], value: -75 },
        { coord: [120.131, 30.248], value: -50 },
        { coord: [120.132, 30.249], value: -39 },
        { coord: [120.133, 30.250], value: -65 },
        { coord: [120.134, 30.251], value: -60 },
        { coord: [120.135, 30.252], value: -54 },
        { coord: [120.136, 30.253], value: -41 },
        { coord: [120.137, 30.254], value: -83 },
        { coord: [120.138, 30.255], value: -91 },
        { coord: [120.139, 30.256], value: -72 },
        { coord: [120.140, 30.257], value: -44 },
        { coord: [120.141, 30.258], value: -66 },
        { coord: [120.142, 30.259], value: -51 },
        { coord: [120.143, 30.260], value: -38 },
        { coord: [120.144, 30.261], value: -61 },
        { coord: [120.145, 30.262], value: -73 },
        { coord: [120.146, 30.263], value: -55 },
        { coord: [120.147, 30.264], value: -49 },
        { coord: [120.148, 30.265], value: -62 },
        { coord: [120.149, 30.266], value: -78 },
        { coord: [120.150, 30.267], value: -54 },
        { coord: [120.151, 30.268], value: -69 },
        { coord: [120.152, 30.269], value: -81 },
        { coord: [120.153, 30.270], value: -56 },
        { coord: [120.154, 30.271], value: -47 },
        { coord: [120.155, 30.272], value: -72 },
        { coord: [120.156, 30.273], value: -65 },
        { coord: [120.157, 30.274], value: -54 },
        { coord: [120.158, 30.275], value: -49 },
        { coord: [120.159, 30.276], value: -39 },
        { coord: [120.160, 30.277], value: -58 },
      ],
      '3G': [
        { coord: [120.150, 30.250], value: -53 },
        { coord: [120.151, 30.251], value: -64 },
        { coord: [120.152, 30.252], value: -41 },
        { coord: [120.153, 30.253], value: -82 },
        { coord: [120.154, 30.254], value: -45 },
        { coord: [120.155, 30.255], value: -68 },
        { coord: [120.156, 30.256], value: -39 },
        { coord: [120.157, 30.257], value: -75 },
        { coord: [120.158, 30.258], value: -50 },
        { coord: [120.159, 30.259], value: -39 },
        { coord: [120.160, 30.260], value: -65 },
        { coord: [120.161, 30.261], value: -60 },
        { coord: [120.162, 30.262], value: -54 },
        { coord: [120.163, 30.263], value: -41 },
        { coord: [120.164, 30.264], value: -83 },
        { coord: [120.165, 30.265], value: -91 },
        { coord: [120.166, 30.266], value: -72 },
        { coord: [120.167, 30.267], value: -44 },
        { coord: [120.168, 30.268], value: -66 },
        { coord: [120.169, 30.269], value: -51 },
        { coord: [120.170, 30.270], value: -38 },
        { coord: [120.171, 30.271], value: -61 },
        { coord: [120.172, 30.272], value: -73 },
        { coord: [120.173, 30.273], value: -55 },
        { coord: [120.174, 30.274], value: -49 },
        { coord: [120.175, 30.275], value: -62 },
        { coord: [120.176, 30.276], value: -78 },
        { coord: [120.177, 30.277], value: -54 },
        { coord: [120.178, 30.278], value: -69 },
        { coord: [120.179, 30.279], value: -81 },
        { coord: [120.180, 30.280], value: -56 },
        { coord: [120.181, 30.281], value: -47 },
        { coord: [120.182, 30.282], value: -72 },
        { coord: [120.183, 30.283], value: -65 },
        { coord: [120.184, 30.284], value: -54 },
        { coord: [120.185, 30.285], value: -49 },
        { coord: [120.186, 30.286], value: -39 },
        { coord: [120.187, 30.287], value: -58 },
        { coord: [120.188, 30.288], value: -62 },
        { coord: [120.189, 30.289], value: -70 },
        { coord: [120.190, 30.290], value: -44 },
        { coord: [120.191, 30.291], value: -60 },
        { coord: [120.192, 30.292], value: -50 },
      ]
    }

    return {
      code: 200,
      message: 'success',
      data: data
    }
  })
}

export const mockSignalTrack = () => {
  Mock.mock(/\/api\/signal\/track/, 'get', (options) => {
    // 解析 URL 参数
    const url = new URL(options.url, window.location.origin)
    const params = Object.fromEntries(url.searchParams)

    // 这里可以使用参数来模拟不同的数据场景
    return {
      code: 200,
      message: 'success',
      data: {
        legends: ['CMCC', 'CUCC', 'CTCC'],
        xaxisData: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
        seriesData: [
          [-20, -32, -1, -34, -90, -30, -10],
          [-20, -82, -91, -4, -20, -33, -31],
          [-50, -32, -20, -15, -19, -3, -4],
     
        ],
      },
    }
  })
}

export const mockSignalStatistics = () => {
  Mock.mock(/\/api\/signal\/statistics/, 'get', (options) => {
    // 解析 URL 参数
    const url = new URL(options.url, window.location.origin)
    const params = Object.fromEntries(url.searchParams)

    // 这里可以使用参数来模拟不同的数据场景
    return {
      code: 200,
      message: 'success',
      data: {
        legends: ['4G', '3G', '2G'],
        xaxisData: ['','商业区', '大学', '住宅区',''],
        seriesData: [
          [0,-20, -32, -10],
          [0,-20, -82, -91],
          [0,-50, -32, -20],
        ],
      },
    }
  })
}



